<template>
  <div style="position: relative;min-height: 100%;">
    <div class="menu-common">
      <menu-top ref="top"></menu-top>
      <div class="content">
        <div class="content-wrap">
          <div>
            <menu-left ref="left" :href="href"></menu-left>
          </div>
          <el-col :span="24">
            <div class="wrap">
              <transition name="el-fade-in-linear" mode="out-in">
                <router-view keep-alive transition="fade" transition-mode='out-in'></router-view>
              </transition>
            </div>
          </el-col>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import VueRouter from "vue-router";
export default {
  name: "menulist",
  data() {
    return {
      href: "",
      state:false
    };
  },
  components: {
    "menu-top": () => import("./Menu-Top"),
    "menu-left": () => import("./Menu-Left")
  },
  watch: {
    $route(to, from) {
      let path = this.$router.currentRoute.path
      if(path == '/loginPage'){
        this.state = false
      }else{
        this.state = true
      }
      
      if (!from.name) return;
      if (from.name == "loginPage") {
        this.$refs.left.leftPermission();
        this.$refs.top.getManager();
      } else {
        this.$refs.left.leftPermission();
      }
    }
  }
};
</script>

<style>
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
}

.menu-common {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  padding-bottom: 100px;
}

.content {
  margin-left: 186px;
  padding-top: 80px;
}

a {
  text-decoration: none;
}

.wrap {
  margin: 20px;
}
</style>